import JSEncrypt from 'jsencrypt'

const PUBLIC_KEY = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCaAvSZaGfNNijVWX8G/Lbq/YpKoz5o5BUvVqfu2fqBBhu8c5D4+sLSed4ZPPZ9OG9KLZMA3XW4j3li+L86dTHYC+a7xLmrVSPeOIYo/NngMHbrOfzrl4kzEGyMTNpwhh5Zpn39C6tWnBv1DbGiL4/V1GEz69ttjD4UUIqvrpqZPQIDAQAB'

export default function rsaEncrypt(str) {
  const encrypt = new JSEncrypt()
  encrypt.setPublicKey(PUBLIC_KEY)
  return encrypt.encrypt(str)
}
